package com.qf.service.impl;

import com.qf.entity.Workorder;
import com.qf.mapper.WorkorderMapper;
import com.qf.service.WorkorderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author ASUS
 * @version V1.0
 * @Project work
 * @Package com.qf.service.impl
 * @Date 2021/10/3 11:45
 */
@Service
public class WorkorderServiceImpl implements WorkorderService {

    @Autowired
    private WorkorderMapper workorderMapper;

    @Override
    public void insert(Workorder workorder) {
        int i = workorderMapper.insert(workorder);
        if(i != 1){
            throw new RuntimeException("添加失败");
        }
    }

    @Override
    public List<Workorder> findAll() {
        return workorderMapper.findAll();
    }
}
